<template>
  <div class="navbar">
    <el-menu
      :default-active="route.fullPath"
      class="el-menu-demo"
      mode="horizontal"
      :router="true"
    >
      <el-menu-item index="/">首页</el-menu-item>
      <el-menu-item index="/news">新闻中心</el-menu-item>
      <el-menu-item index="/product">产品与服务</el-menu-item>
      <el-menu-item index="" @click="handleClick">登录</el-menu-item>
    </el-menu>
    <div class="right">企业门户官网</div>
  </div>
</template>

<script setup name="">
import { useRoute } from "vue-router";
const route = useRoute();

const handleClick = () => {
  window.location = "http://localhost:5174";
};
</script>

<style scoped lang="scss">
.navbar {
  position: fixed; /* 将 navbar 设置为固定定位 */
  top: 0;
  left: 0;
  width: 100%;
  background-color: white;
  z-index: 1000; /* 设置一个较高的 z-index 值，确保 navbar 在其他元素之上 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影效果，使 navbar 看起来更立体 */
}

.right {
  position: fixed;
  top: 0;
  right: 20px;
  width: 100px;
  height: 59px;
  line-height: 59px;
  text-align: center;
}
</style>
